package Test;

import java.util.Arrays;

public class Student {

    String name;
    int score;

    public Student(String name,int score) {
        this.name = name;
        this.score = score;
    }

    public static void main(String[] args) {
        Student[] arr = {//创建Student数组
                new Student("张三",18),
                new Student("李四",17),
                new Student("王五",19),
                new Student("赵六",20),
        };
        //接下来使用sort方法对其进行排序
        Arrays.sort(arr);
        for(Student i:arr){
            System.out.print(i + " ");
        }
    }

   /* public String name;//姓名
    public String gender;//性别
    public int age;//年龄
    private static String classRoom = "306教室";

    public static String getClassRoom(){
        return classRoom;
    }
    //先是对于  静态成员方法调用成员方法
    public static void print(){
        Student s1 = new Student();
        s1.age = 18;//对象调用
    }
    public void printf(){
        System.out.println("我是成员方法");
    }
    //静态方法内部不包含任何的this引用
    public static void main(String[] args) {//这也是一个静态方法
        Student s1 = new Student();
        s1.print();
    }*/
   /* public static void main1(String[] args) {
        Student s1 = new Student();//学生s1
        Student s2 = new Student();//学生s2
        Student s3 = new Student();//学生s3
        System.out.println(s1.classRoom);
        System.out.println(s2.classRoom);
        System.out.println(Student.classRoom);
        s1.classRoom = "888教室";
        System.out.println(s3.classRoom);
        System.out.println(Student.classRoom);

    }*/
}
